<head>
    <meta http-equiv="content-type" content="text/html;charset=utf-8" />
    <meta name="author" content="Administrator" />

    <title>Trang chủ - 247mall.vn</title>
    <link href="{{'data/templates/frontend/home/css/style.css'|base_url}}" rel="stylesheet" />
    <script type="text/javascript" src="{{'data/templates/frontend/home/js/jquery.1.7.2.js'|base_url}}"></script>
    <script type="text/javascript" src="{{'data/templates/frontend/home/js/jquery.cycle.all.js'|base_url}}"></script>
    <script type="text/javascript" src="{{'data/templates/frontend/home/js/preloadify.js'|base_url}}"></script>
    <script type="text/javascript" src="{{'data/templates/frontend/home/js/action.js'|base_url}}"></script>
    <script type="text/javascript" src="{{'data/templates/frontend/home/js/skype-uri.js'|base_url}}"></script>

    <script>
        (function(d, s, id) {
            var js, fjs = d.getElementsByTagName(s)[0];
            if (d.getElementById(id)) return;
            js = d.createElement(s); js.id = id;
            js.src = "//connect.facebook.net/vi_VN/all.js#xfbml=1";
            fjs.parentNode.insertBefore(js, fjs);
        }(document, 'script', 'facebook-jssdk'));
        
        function addItemToCart(proid)
        {
            var odata={
                proid:proid,
                ajax:1
            };
            jQuery.ajax({
                type:"POST", 
                data:odata, 
                dataType:"text", 
                url:"{{'cart/add_cart_item'|base_url}}", 
                success: function (data){
                    //isrunning=false;
                    var r = JSON.parse(data);console.log(r);
                    if(r.result=='true')
                    {
                        alert('Đã thêm vào giỏ hàng.');
                        $("div.amount").html('<span>'+r.total+'</span>');
                    }
                },
                error: function (xhr, ajaxOptions, thrownError){
                    //isrunning=false;
                    alert("Hệ thống đang bận hoăc bảo trì.\nVui lòng thử lại sau ít phút.");
                }
            });
        }
    </script>
</head>